Canvas画图,可以实现柱图、折线图、饼图等等
<Window x:Class="WPFChartControlExample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:chart="clr-namespace:IgorCrevar.WPFChartControl;assembly=WPFChartControl" Title="MainWindow" Height="660" Width="880"> <Grid Background="#DDDDDDDD"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <TextBlock Grid.Row="0" Text="Bar Chart" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/> <chart:ChartControl Grid.Row="1" Drawer="{Binding Path=BarChartDrawer}" Margin="0,0,0,30" MinWidth="100" MinHeight="100"/> <TextBlock Grid.Row="2" Text="Stacked Bar Chart" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/> <chart:ChartControl Grid.Row="3" Drawer="{Binding Path=StackedBarChartDrawer}" Margin="0,0,0,30" MinWidth="100" MinHeight="100"/> <TextBlock Grid.Row="4" Text="Line Series Chart" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/> <chart:ChartControl Grid.Row="5" Drawer="{Binding Path=LineSeriesChartDrawer}" MinWidth="100" MinHeight="100"/> </Grid></Window>
评论